<template>
  <scroller lock-x scrollbar-y use-pullup height="-46" use-pulldown @on-pullup-loading="loadMore"
            @on-pulldown-loading="refresh" v-model="status" ref="scroller">
    <div class="weui-panel__bd">
      <div class="weui-media-box weui-media-box_text" v-for="item in newsList">
        <h4 class="weui-media-box__title">{{ item.title }}</h4>
        <ul class="weui-media-box__info">
          <li class="weui-media-box__info__meta">{{ item.source }}</li>
          <li class="weui-media-box__info__meta">{{ item.released_dtime }}</li>
        </ul>
      </div>
    </div>
  </scroller>
</template>

<script>
  import Scroller from 'vux/src/components/scroller/index'

  export default {
    components: {
      Scroller
    },
    methods: {
      getNews () {
        let url = 'https://ydt.xy12345.cn/edot/news/info/selectInfoList'
        let param = {
          'catId': this.catId,
          'curPageNum': this.curPageNum,
          'pageCount': this.pageCount,
          'dictId': this.dictId,
          'isShowThumb': this.isShowThumb
        }
        this.$axios.post(url, this.$qs.stringify(param)).then(response => {
          this.newsList = response.data.data
          console.log(this.newsList)
        })
      }
    },
    mounted () {
      this.getNews()
    },
    data () {
      return {
        newsList: [],
        catId: '10011',
        curPageNum: 1,
        pageCount: 10,
        dictId: 'news_cat',
        isShowThumb: false
      }
    }
  }
</script>

<style lang="less" scoped>
  @import '~vux/src/styles/weui/widget/weui_panel/weui_panel.less';
  @import '~vux/src/styles/weui/widget/weui_media_box/weui_media_box.less';
</style>
